//导入请求工具类
import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

// 文章分类查询
export const articleCategoryListService = () => {
    return request.get('/category')
}

// 添加文章分类
export const articleCategoryAddService = (categoryDta) => {
    return request.post('/category', categoryDta)
}

// 更新文章分类
export const articleCategoryUpdateService = (categoryDta) => {
    return request.put('/category/update', categoryDta)
}

// 删除文章分类
export const articleCategoryDeleteService = (id) => {
    return request.delete('/category?id='+id)
}

// 查询文章列表
export const articleListService = (params) => {
    return request.get('/article',{ params: params })
}

// 添加文章
export const articleAddService = (articleData) => {
    return request.post('/article', articleData)
}